package cn.hsa.fqz.common.enums;

public enum WarnTypeEnum {
    DEAD_VISIT("死亡就医",1),HUNG_BED_HOSPITAL("挂床住院",2),INDUCE_HOSPITAL("诱导住院",3),EXCEED_MEDICAL("过度医疗",4),POLICE_INSPECT("公安监督",5);

    private String label;

    private Integer code;

    WarnTypeEnum(String value,Integer code){
        this.label = value;
        this.code = code;
    }

    public String getLabel(){
        return this.label;
    }

    public Integer getCode(){return this.code;}

    public static WarnTypeEnum getByCode(Integer code){
        WarnTypeEnum result = null;
        for (WarnTypeEnum enums:WarnTypeEnum.values()) {
            if(enums.getCode().intValue() == code){
                result =  enums;
            }
        }
        return result;
    }

    public static WarnTypeEnum getByLabel(String label){
        WarnTypeEnum result = null;
        for (WarnTypeEnum enums:WarnTypeEnum.values()) {
            if(label.equals(enums.getLabel())){
                result =  enums;
            }
        }
        return result;
    }
}
